import matplotlib.pyplot as plt 
import numpy as np

x = np.linspace(0, 80)
fig = plt.figure()

y1 = x*np.log2(x)
y2 = x**2
y3 = x*np.log2(x)
y4 = x*np.log2(x)
y5 = x**2

plt.title('Time complexity')
plt.xlabel('input n')
plt.ylabel('time spent t')

#插入注释

plt.plot(x,y1,label='堆排序')
plt.plot(x,y2,label='冒泡排序')
plt.plot(x,y3,label='二分归并排序')
plt.plot(x,y3,label='快速排序')
plt.plot(x,y3,label='插入排序')
plt.legend(loc='upper right')
plt.rcParams['font.sans-serif']=['SimHei']

plt.show()  